package com.code.model.bo;

import com.code.commons.model.po.BasePO;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

/**
 * api的相关版本号
 *
 * @author tangyifei
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class ApiLog extends BasePO<String> {

    private static final long serialVersionUID = -7491215402569546438L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "SELECT REPLACE(UUID(),'-','')")
    @Length(min = 1, max = 64)
    private String id;

    /**
     * 登陆用户主键
     */
    private String userId;

    /**
     * 目标方法名称
     */
    private String targetMethodName;

    /**
     * 目标方法参数信息
     */
    private String targetMethodParam;

    /**
     * 执行目标方法结果
     */
    private String targetMethodResult;

    /**
     * 请求中的ip地址
     */
    private String ip;

    /**
     * app的版本
     */
    private String appVersion;

    /**
     * app变更版本说明(即更新了什么内容等)
     */
    private String appVersionContent;

    /**
     * api的版本
     */
    private String apiVersion;

    /**
     * 调用来源
     */
    private String callSource;

    /**
     * 用户的引擎
     */
    private String userAgent;

}
